package com.songlanyun.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;
import com.songlanyun.common.drive.IntegerEnum;

/**
 * 区块链交易枚举
 * @author zhangqh
 */
public class ChainConstant {

    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public static enum ChainBsType implements IntegerEnum<Integer> {

        CHAIN_OUT(0, "兑换"),
        CHAIN_IN(1, "转入"),
        ;

        @EnumValue
        @JsonValue
        private Integer code;

        private String msg;

        ChainBsType(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        @Override
        public String getMsg() {
            return msg;
        }
    }

    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public static enum ChainBsStatus implements IntegerEnum<Integer> {

        SAVE(0, "未审核"),
        WITHDRAWALING(1, "兑换中"),
        WITHDRAW_SUCCESS(2, "兑换成功"),
        POINT_DEAL(3, "积分处理完成"),
        AUDIT_FAIL(4, "审核不通过"),
        WITHDRAW_FAIL(5, "兑换失败"),
        ;

        @EnumValue
        @JsonValue
        private Integer code;

        private String msg;

        ChainBsStatus(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        @Override
        public String getMsg() {
            return msg;
        }
    }

    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public static enum ChainTransferNet implements IntegerEnum<Integer> {

        NET_1(0, "BNB Smart Chain(BEP20)"),
        ;

        @EnumValue
        @JsonValue
        private Integer code;

        private String msg;

        ChainTransferNet(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        @Override
        public String getMsg() {
            return msg;
        }
    }

    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public static enum ChainPayType implements IntegerEnum<Integer> {

        TYPE_1(0, "现货钱包"),
        ;

        @EnumValue
        @JsonValue
        private Integer code;

        private String msg;

        ChainPayType(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        @Override
        public String getMsg() {
            return msg;
        }
    }
}
